﻿using System;

namespace Aeon.Framework.Audio
{

/// <summary>
/// Audio object class.
/// 
/// </summary>
public class AeonAudio : IAudio
    {
    // --- Attributes:

    private String file;        // Source file path.
    private Single volume;      // Normalized volume between 0 and 1.

    private AudioMode mode;     // Sound settings flags.
    private Int32 channel;      // Sound channel.

    // --- Properties:

    public String Source { get { return(file); } }

    public Int32 Channel { get { return(channel); } set { channel = value; } }
    public AudioMode Settings { get { return(mode); } set { mode = value; } }

    public Single Volume { 
                         get { return(volume); }
                         set {
                             if (value >= 0 && value <= 1) volume = value;
                             else {
                                  if (value < 0) volume = 0;
                                  if (value > 1) volume = 1;
                                  }
                             }
                         }

    // --- Constructor:

    public AeonAudio(String source) : this(source, 1, AudioMode.Default) { }
    public AeonAudio(String source, Single volume) : this(source, volume, AudioMode.Default) { }
        
    public AeonAudio(String source, Single volume, AudioMode settings)
        {
        this.volume = volume;

        mode = settings;
        file = source;
        channel = -1;
        }

    }


}
